<?php

/**
 * LoginForm class.
 * LoginForm is the data structure for keeping
 * user login form data. It is used by the 'login' action of 'SiteController'.
 */
class BlogThumbForm extends CFormModel {

    public $image;
    public $blog;

    /**
     * Declares the validation rules.
     * The rules state that username and password are required,
     * and password needs to be authenticated.
     */
    public function rules() {
        return array(
            array('blog', 'required'),
            array('blog', 'numerical', 'integerOnly' => true),
            array('image', 'file', 'allowEmpty' => false,
                'types' => 'jpg, gif, png, jpeg',
                'maxSize' => 1024 * 1024 * 10, // 10MB
                'tooLarge' => 'The file was larger than 10MB. Please upload a smaller file.',
            ),
        );
    }

    /**
     * Declares attribute labels.
     */
    public function attributeLabels() {
        return array(
            'image' => 'Image File',
        );
    }

}
